/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session06;

import java.util.Scanner;

/**
 *
 * @author macbookpro
 */
public class TestData {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Name: ");
        String name = input.nextLine();

        System.out.println("name.matches: "+ name.matches("^[a-zA-Z]+[a-zA-Z\\s]*$"));
        
        if (ValidData.isName(name)) {
            System.out.println("Name: " + name);
        } else {
            System.out.println(name + " invalid!");
        }
        
        System.out.print("Input String: ");
        String str = input.nextLine();
        
        System.out.println(str.replace("a", "b"));
        System.out.println(str.replaceAll("a", "b"));
    }
}
